include_directories( ${CMAKE_SOURCE_DIR}/clang-iup/include )
include_directories( ${CMAKE_SOURCE_DIR}/clang-iup/src)

set( SRC
	iup.c
	iup_array.c
	iup_array.h
	iup_assert.c
	iup_assert.h
	iup_attrib.c
	iup_attrib.h
	iup_box.c
	iup_box.h
	iup_button.c
	iup_button.h
	iup_callback.c
	iup_canvas.c
	iup_canvas.h
	iup_cbox.c
	iup_childtree.c
	iup_childtree.h
	iup_class.c
	iup_class.h
	iup_classattrib.c
	iup_classbase.c
	iup_classbase.h
	iup_colordlg.c
	iup_dialog.c
	iup_dialog.h
	iup_dlglist.c
	iup_dlglist.h
	iup_draw.h
	iup_drv.h
	iup_drvfont.h
	iup_drvinfo.h
	iup_filedlg.c
	iup_fill.c
	iup_focus.c
	iup_focus.h
	iup_font.c
	iup_fontdlg.c
	iup_frame.c
	iup_frame.h
	iup_func.c
	iup_func.h
	iup_getparam.c
	iup_globalattrib.c
	iup_globalattrib.h
	iup_hbox.c
	iup_image.c
	iup_image.h
	iup_key.c
	iup_key.h
	iup_label.c
	iup_label.h
	iup_layout.c
	iup_layout.h
	iup_ledlex.c
	iup_ledlex.h
	iup_ledparse.c
	iup_list.c
	iup_list.h
	iup_mask.c
	iup_mask.h
	iup_maskmatch.c
	iup_maskmatch.h
	iup_maskparse.c
	iup_maskparse.h
	iup_menu.c
	iup_menu.h
	iup_messagedlg.c
	iup_names.c
	iup_names.h
	iup_normalizer.c
	iup_object.c
	iup_object.h
	iup_open.c
	iup_predial.c
	iup_predial.h
	iup_progressbar.c
	iup_progressbar.h
	iup_radio.c
	iup_register.c
	iup_register.h
	iup_sbox.c
	iup_scanf.c
	iup_show.c
	iup_spin.c
	iup_split.c
	iup_stdcontrols.h
	iup_str.c
	iup_str.h
	iup_strmessage.c
	iup_strmessage.h
	iup_table.c
	iup_table.h
	iup_tabs.c
	iup_tabs.h
	iup_text.c
	iup_text.h
	iup_timer.c
	iup_timer.h
	iup_toggle.c
	iup_toggle.h
	iup_tree.c
	iup_tree.h
	iup_user.c
	iup_val.c
	iup_val.h
	iup_vbox.c
	iup_zbox.c
)
if( WIN32 )
	add_definitions(-D_WIN32_WINNT=0x0500)
	add_definitions(-D_WIN32_IE=0x0500)
	add_definitions(-DWINVER=0x0500)
	add_definitions(-DNOTREEVIEW)
	include_directories( ${CMAKE_SOURCE_DIR}/clang-iup/src/win)
	set( SRC ${SRC}
		win/iupwin_brush.c
		win/iupwin_brush.h
		win/iupwin_button.c
		win/iupwin_canvas.c
		win/iupwin_clipboard.c
		win/iupwin_colordlg.c
		win/iupwin_common.c
		win/iupwin_dialog.c
		win/iupwin_draw.c
		win/iupwin_draw.h
		win/iupwin_drv.h
		win/iupwin_filedlg.c
		win/iupwin_focus.c
		win/iupwin_font.c
		win/iupwin_fontdlg.c
		win/iupwin_frame.c
		win/iupwin_globalattrib.c
		win/iupwin_handle.c
		win/iupwin_handle.h
		win/iupwin_image.c
		win/iupwin_info.c
		win/iupwin_info.h
		win/iupwin_key.c
		win/iupwin_label.c
		win/iupwin_list.c
		win/iupwin_loop.c
		win/iupwin_menu.c
		win/iupwin_messagedlg.c
		win/iupwin_open.c
		win/iupwin_progressbar.c
		win/iupwin_tabs.c
		win/iupwin_text.c
		win/iupwin_timer.c
		win/iupwin_tips.c
		win/iupwin_toggle.c
		win/iupwin_tree.c
		win/iupwin_val.c
		win/iupwindows_help.c
		win/iupwindows_info.c
		win/iupwindows_main.c
	)
endif( WIN32 )

if( LINUX )
	include_directories( ${CMAKE_SOURCE_DIR}/clang-iup/src/gtk)
	set( SRC ${SRC}
		gtk/iupgtk_button.c
		gtk/iupgtk_canvas.c
		gtk/iupgtk_clipboard.c
		gtk/iupgtk_colordlg.c
		gtk/iupgtk_common.c
		gtk/iupgtk_dialog.c
		gtk/iupgtk_draw.c
		gtk/iupgtk_drv.h
		gtk/iupgtk_filedlg.c
		gtk/iupgtk_focus.c
		gtk/iupgtk_font.c
		gtk/iupgtk_fontdlg.c
		gtk/iupgtk_frame.c
		gtk/iupgtk_globalattrib.c
		gtk/iupgtk_help.c
		gtk/iupgtk_image.c
		gtk/iupgtk_key.c
		gtk/iupgtk_label.c
		gtk/iupgtk_list.c
		gtk/iupgtk_loop.c
		gtk/iupgtk_menu.c
		gtk/iupgtk_messagedlg.c
		gtk/iupgtk_open.c
		gtk/iupgtk_progressbar.c
		gtk/iupgtk_tabs.c
		gtk/iupgtk_text.c
		gtk/iupgtk_timer.c
		gtk/iupgtk_tips.c
		gtk/iupgtk_toggle.c
		gtk/iupgtk_tree.c
		gtk/iupgtk_val.c
	)
endif( LINUX )

#if( APPLE )
#	include_directories( ${CMAKE_SOURCE_DIR}/clang-iup/src/gtk)
#	set( SRC ${SRC}
#		gtk/iupgtk_button.c
#		gtk/iupgtk_canvas.c
#		gtk/iupgtk_clipboard.c
#		gtk/iupgtk_colordlg.c
#		gtk/iupgtk_common.c
#		gtk/iupgtk_dialog.c
#		gtk/iupgtk_draw.c
#		gtk/iupgtk_drv.h
#		gtk/iupgtk_filedlg.c
#		gtk/iupgtk_focus.c
#		gtk/iupgtk_font.c
#		gtk/iupgtk_fontdlg.c
#		gtk/iupgtk_frame.c
#		gtk/iupgtk_globalattrib.c
#		gtk/iupgtk_help.c
#		gtk/iupgtk_image.c
#		gtk/iupgtk_key.c
#		gtk/iupgtk_label.c
#		gtk/iupgtk_list.c
#		gtk/iupgtk_loop.c
#		gtk/iupgtk_menu.c
#		gtk/iupgtk_messagedlg.c
#		gtk/iupgtk_open.c
#		gtk/iupgtk_progressbar.c
#		gtk/iupgtk_tabs.c
#		gtk/iupgtk_text.c
#		gtk/iupgtk_timer.c
#		gtk/iupgtk_tips.c
#		gtk/iupgtk_toggle.c
#		gtk/iupgtk_tree.c
#		gtk/iupgtk_val.c
#		gtk/iupmac_help.c
#		gtk/iupmac_info.c
#	)
#endif( APPLE )

if( APPLE )
	include_directories( ${CMAKE_SOURCE_DIR}/clang-iup/src/osx)
	set( SRC ${SRC}
	)
endif( APPLE )


add_library( clangiup SHARED ${SRC})

if( WIN32 )
	target_link_libraries( clangipu 
		comctl32 ole32 kernel32 user32 gdi32 winspool comdlg32 advapi32 shell32 ole32 
		)
endif( WIN32 )


